#ifndef MULTI_VARIATE_INTERPOLATION
#define MULTI_VARIATE_INTERPOLATION
#include "Interpolation.h"
#include "boost/multi_array.hpp"
#include <valarray>
#include <string>
using namespace std;
using namespace boost;
#define DBG_MV_INTERP 0
class MultiVariateInterpolation : public Interpolation
{
   private:
         
      map< int, vector< double > > inputMap;
   
      int numOfParameters;
      
      Interpolation* spline1D;
      Interpolation* line1D;
      //points at which the interpolation is to be performed
      vector< double > evaluationPoints;
      vector<int> bounds;
      typedef multi_array<double, 3> array3;
      typedef multi_array<double, 4> array4;
      //array outputArray;
         
   public:
      MultiVariateInterpolation( );
      ~MultiVariateInterpolation( );
      
      void SetInputPoints( map< int, vector< double > > inp, 
            multi_array<double,3> out );
      void SetInputPoints( map< int, vector< double > > inp, 
            multi_array<double,4> out );
      void SetNumberOfParameters( int params );
      double EvaluateCubicSplineAt( vector<double> evalPoints, 
         multi_array<double,3> out );
      
      double EvaluateCubicSplineAt( vector<double> evalPoints, 
         multi_array<double,4> out );
      //linear interpolation evaluations
      double EvaluateLinearAt( vector<double> evalPoints, 
         multi_array<double,3> out );
      double EvaluateLinearAt( vector<double> evalPoints, 
         multi_array<double,4> out );
};
#endif //MULTI_VARIATE_INTERPOLATION
